import fetch from 'utils/fetch'
// 注册
export function register (registerAccount, registerPassword, roleType) {
  const data = {
    registerAccount,
    registerPassword,
    roleType
  }
  return fetch({
    url: '/users/register',
    method: 'post',
    data
  })
}
// 登陆时验证用户名和密码是否正确 或者 是否注册
export function validateLoginUserInfor (account, password) {
  const data = {
    account,
    password
  }
  return fetch({
    url: '/users/validateLoginUserInfor',
    method: 'post',
    data
  })
}

// 登陆
export function login (account, password) {
  const data = {
    account,
    password
  }
  return fetch({
    url: '/users/login',
    method: 'post',
    data
  })
}
